<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
	<title>用户管理</title>
</head>

<body>	
	
	<div class="main-content-inner">
		<!-- #section:basics/content.breadcrumbs -->
		<div class="breadcrumbs" id="breadcrumbs">
			<script type="text/javascript">
				try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
			</script>
	
			<ul class="breadcrumb">
				<li>
					<i class="ace-icon fa fa-home home-icon"></i>
					<a href="${ctx}/welcome">主页</a>
				</li>
				<li class="active">用户管理</li>
			</ul><!-- /.breadcrumb -->
	
			<!-- #section:basics/content.searchbox -->
			<div class="nav-search" id="nav-search">
				<form class="form-search" action="#">
					<span class="input-icon">
						<input type="text" autocomplete="off" name="search_LIKE_loginName" placeholder="登录名 ..." class="nav-search-input" id="nav-search-input" autocomplete="off" value="${param.search_LIKE_loginName}" />
						<i class="ace-icon fa fa-search nav-search-icon"></i>
					</span>
					<input type="button" value="搜索" onclick = "$('.form-search').submit();" />
				</form>
			</div><!-- /.nav-search -->
	
			<!-- /section:basics/content.searchbox -->
		</div>	
		<!-- /section:basics/content.breadcrumbs -->
		
		<div class="page-content">
			
			<c:if test="${not empty message}">
				<div id="message" class="alert alert-success"><button data-dismiss="alert" class="close">×</button>${message}</div>
			</c:if>	
			
			<div class="page-header">
				<h1>
					用户管理
					<small>
						<i class="ace-icon fa fa-angle-double-right"></i>
						列表
					</small>
				</h1>
			</div><!-- /.page-header -->			
			
			<div class="row">
				<div class="col-xs-12">
					<!-- PAGE CONTENT BEGINS -->
					
					<table id="sample-table-1" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th class="center">
									<label class="position-relative">
										<input type="checkbox" class="ace" />
										<span class="lbl"></span>
									</label>
								</th>
								<th>登录名</th>
								<th>用户名</th>
								<th>所属驾校</th>
								<th>注册时间</th>
								<th>管理</th>
							</tr>
						</thead>

						<tbody>
							<c:forEach items="${users.content}" var="user">
							<tr>
								<td class="center">
									<label class="position-relative">
										<input type="checkbox" class="ace" />
										<span class="lbl"></span>
									</label>
								</td>

								<td>
									<a href="${ctx}/admin/user/update/${user.id}">${user.loginName}</a>
								</td>
								
								<td>
									${user.name }
								</td>
								
								<td>
									${user.school.name }
								</td>	
								
								<td>
									<fmt:formatDate value="${user.registerDate}" pattern="yyyy年MM月dd日  HH时mm分ss秒" />
								</td>							

								<td>
									<div class="hidden-sm hidden-xs btn-group">
										
										<a class="btn btn-xs btn-info" href="${ctx}/admin/user/update/${user.id}">
											修改
										</a>

										<a class="btn btn-xs btn-danger" href="${ctx}/admin/user/delete/${user.id}">
											删除
										</a>

									</div>

								</td>
							</tr>
							</c:forEach>
						</tbody>
					</table>
							
				</div>
			</div>
			
			<tags:pagination page="${users}" paginationSize="5"/>
		
			<div><a class="btn btn-info" href="${ctx}/register">创建新用户</a></div>
		</div><!-- /.page-content -->
	</div>
</body>
</html>
